#include<stdio.h>

int nocmp (int *ptr1, int *ptr2)
{
	int m1,m2,i;
	m1=*ptr1;
	m2=*ptr2;
	for (i=0;i<ptr2-ptr1;i++)
		if (m1<*(ptr1+i))
			m1=*(ptr1+i);
	for (i=0;i<ptr2-ptr1;i++)
		if (m2<*(ptr2+i))
			m2=*(ptr2+i);
	if (m1<m2)
		return m2;
	else
		return m1;
} 

int main()
{
	int n=0,i,a[500];
	while (scanf("%d",&a[n])==1)
		n++;
	int ans;
	ans=nocmp(a,a+n/2);
	printf("%d\n",ans);
	return 0;
}
